import React, {Component} from 'react';
import {
    Button,
    Platform,
    StyleSheet,
    Text,
    TextInput,
    View
} from 'react-native';

import {TabNavigator, TabBarBottom, createStackNavigator} from 'react-navigation'; // 1.0.0-beta.27


export default class XmgWelcome extends React.Component {
    static navigationOptions = {
        title: '欢迎',
        headerStyle: {
            backgroundColor: '#055099',
        },
        headerTintColor: '#fff',
        headerTitleStyle: {
            fontWeight: 'bold',
            fontSize: 16,
        },
        headerLeft: (
            <Button
                title="back"
                color="#ffffff00"
            />
        ),
        headerRight: (
            <Button
                onPress={() => alert('This is a button!')}
                title="Itiels"
                color="#ffffff00"
            />
        ),
    };

    render() {
        return (
            <View style={styles.container}>
                <Text style={styles.welcome}>
                    欢迎
                </Text>
                <Button
                    title="欢迎"
                    onPress={() => {
                        this.props.navigation.pop();
                        this.props.navigation.navigate('main');
                    }}
                />
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    },
    instructions: {
        textAlign: 'center',
        color: '#333333',
        marginBottom: 5,
    },
    textInput: {
        width: 200,
        color: '#333333',
        height: 60,
        marginTop: 50,
    },
});




